<template>
  <div>
    <h1>管理员信息</h1>
    <el-form>
      <el-form-item label="账号">
        <el-input v-model="admins.account" :disabled="true"></el-input>
      </el-form-item>
      <el-form-item label="密码">
        <el-input v-model="admins.password" :disabled="true"></el-input>
      </el-form-item>
      <el-form-item label="权限">
        <el-input v-model='power' :disabled="true"></el-input>
      </el-form-item>
      <el-form-item label="状态">
        <el-input v-model="state" :disabled="true"></el-input>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
import axios from "axios";

  export default {
    data(){
      return {
        admins:{},
        power:"",
        state:""
      }
    },
    created(){
      this.getSelfAdmin();
    },
    methods:{
      async getSelfAdmin(){
        const res=await this.$http.post('/admins/getSelfAdmin');
        console.log(res);
        this.admins={...res.data};
        if(this.admins.power==1){
          this.power="超级管理员";
        }else{
          this.power="普通管理员";
        }
        if(this.admins.state==1){
          this.state="正常";
        }else{
          this.state="禁用";
        }
      }
    }
  }
</script>

<style lang="scss" scoped>

</style>